#include "settings_widget.h"
#include "ui_settings_widget.h"


SettingsWidget::SettingsWidget(QWidget* parent) :
    QDialog(parent),
    ui(new Ui::SettingsDialog)
{
    ui->setupUi(this);

    //ui->rb_sw_ffmpeg->setChecked(true);
    ui->rb_hw_d3d11->setChecked(true);
}

SettingsWidget::~SettingsWidget()
{
    delete ui;
}

SettingsWidget::ENUM_DECODE_TYPE SettingsWidget::get_decode_type() const
{
    ENUM_DECODE_TYPE type;
    if (ui->rb_sw_ffmpeg->isChecked())
    {
        type =  ENUM_DECODE_TYPE::SW_FFMPEG;
    }
    else if (ui->rb_hw_d3d11->isChecked())
    {
        type = ENUM_DECODE_TYPE::HW_D3D11;
    }
    else if (ui->rb_hw_dxva->isChecked())
    {
        type = ENUM_DECODE_TYPE::HW_DXVA;
    }
    else
    {
        type = ENUM_DECODE_TYPE::UNKNOWN;
    }

    return type;
}

bool SettingsWidget::get_bt709() const
{
    return (ui->cb_bt709->checkState() == Qt::Checked);
}
